<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Qwt User&#39;s Guide: QwtTextEngine Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Qwt User&#39;s Guide
   &#160;<span id="projectnumber">6.1.3</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_qwt_text_engine.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="class_qwt_text_engine-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">QwtTextEngine Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p>Abstract base class for rendering text strings.  
 <a href="class_qwt_text_engine.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="qwt__text__engine_8h_source.html">qwt_text_engine.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for QwtTextEngine:</div>
<div class="dyncontent">
<div class="center"><img src="class_qwt_text_engine__inherit__graph.png" border="0" usemap="#_qwt_text_engine_inherit__map" alt="Inheritance graph"/></div>
<map name="_qwt_text_engine_inherit__map" id="_qwt_text_engine_inherit__map">
<area shape="rect" id="node2" href="class_qwt_math_m_l_text_engine.html" title="Text Engine for the MathML renderer of the Qt solutions package. " alt="" coords="5,80,167,107"/>
<area shape="rect" id="node3" href="class_qwt_plain_text_engine.html" title="A text engine for plain texts. " alt="" coords="191,80,335,107"/>
<area shape="rect" id="node4" href="class_qwt_rich_text_engine.html" title="A text engine for Qt rich texts. " alt="" coords="360,80,500,107"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:adda9e23494429c54b3cc3452940fb2bc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adda9e23494429c54b3cc3452940fb2bc"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#adda9e23494429c54b3cc3452940fb2bc">~QwtTextEngine</a> ()</td></tr>
<tr class="memdesc:adda9e23494429c54b3cc3452940fb2bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:adda9e23494429c54b3cc3452940fb2bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2029524166188b740ebc27ab553e234"><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#ae2029524166188b740ebc27ab553e234">heightForWidth</a> (const QFont &amp;font, int flags, const QString &amp;text, double width) const  =0</td></tr>
<tr class="separator:ae2029524166188b740ebc27ab553e234"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6888b3d286a16a7b8e06db8147e43df0"><td class="memItemLeft" align="right" valign="top">virtual QSizeF&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#a6888b3d286a16a7b8e06db8147e43df0">textSize</a> (const QFont &amp;font, int flags, const QString &amp;text) const  =0</td></tr>
<tr class="separator:a6888b3d286a16a7b8e06db8147e43df0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55e011afec9b5a3f6d79b19652bc2bdf"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#a55e011afec9b5a3f6d79b19652bc2bdf">mightRender</a> (const QString &amp;text) const  =0</td></tr>
<tr class="separator:a55e011afec9b5a3f6d79b19652bc2bdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f3dbeaffeae25c11d543143229c5c4a"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#a9f3dbeaffeae25c11d543143229c5c4a">textMargins</a> (const QFont &amp;font, const QString &amp;text, double &amp;left, double &amp;right, double &amp;top, double &amp;bottom) const  =0</td></tr>
<tr class="separator:a9f3dbeaffeae25c11d543143229c5c4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a760296fb835a9db44d310616fa9eef89"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#a760296fb835a9db44d310616fa9eef89">draw</a> (QPainter *painter, const QRectF &amp;rect, int flags, const QString &amp;text) const  =0</td></tr>
<tr class="separator:a760296fb835a9db44d310616fa9eef89"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a97c5ef76ee920ab0f19e178e85017d9d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a97c5ef76ee920ab0f19e178e85017d9d"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#a97c5ef76ee920ab0f19e178e85017d9d">QwtTextEngine</a> ()</td></tr>
<tr class="memdesc:a97c5ef76ee920ab0f19e178e85017d9d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br /></td></tr>
<tr class="separator:a97c5ef76ee920ab0f19e178e85017d9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Abstract base class for rendering text strings. </p>
<p>A text engine is responsible for rendering texts for a specific text format. They are used by <a class="el" href="class_qwt_text.html" title="A class representing a text. ">QwtText</a> to render a text.</p>
<p><a class="el" href="class_qwt_plain_text_engine.html" title="A text engine for plain texts. ">QwtPlainTextEngine</a> and <a class="el" href="class_qwt_rich_text_engine.html" title="A text engine for Qt rich texts. ">QwtRichTextEngine</a> are part of the Qwt library. The implementation of <a class="el" href="class_qwt_math_m_l_text_engine.html" title="Text Engine for the MathML renderer of the Qt solutions package. ">QwtMathMLTextEngine</a> uses code from the Qt solution package. Because of license implications it is built into a separate library.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_text.html#aef6a1e71b1feba3116ce69f6c9de70ad">QwtText::setTextEngine()</a> </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a760296fb835a9db44d310616fa9eef89"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void QwtTextEngine::draw </td>
          <td>(</td>
          <td class="paramtype">QPainter *&#160;</td>
          <td class="paramname"><em>painter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QRectF &amp;&#160;</td>
          <td class="paramname"><em>rect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>text</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Draw the text in a clipping rectangle</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">painter</td><td>Painter </td></tr>
    <tr><td class="paramname">rect</td><td>Clipping rectangle </td></tr>
    <tr><td class="paramname">flags</td><td>Bitwise OR of the flags like in for QPainter::drawText() </td></tr>
    <tr><td class="paramname">text</td><td>Text to be rendered </td></tr>
  </table>
  </dd>
</dl>

<p>Implemented in <a class="el" href="class_qwt_rich_text_engine.html#a8f345540be2a90db3ce5a252ec443ce7">QwtRichTextEngine</a>, <a class="el" href="class_qwt_plain_text_engine.html#a5fc2780c10ac2fb41aec91223b60fac7">QwtPlainTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#a4a347e3f7ac8fa7f57c4fcf62e4f2b36">QwtMathMLTextEngine</a>.</p>

</div>
</div>
<a class="anchor" id="ae2029524166188b740ebc27ab553e234"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual double QwtTextEngine::heightForWidth </td>
          <td>(</td>
          <td class="paramtype">const QFont &amp;&#160;</td>
          <td class="paramname"><em>font</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>width</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Find the height for a given width</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">font</td><td>Font of the text </td></tr>
    <tr><td class="paramname">flags</td><td>Bitwise OR of the flags used like in QPainter::drawText </td></tr>
    <tr><td class="paramname">text</td><td>Text to be rendered </td></tr>
    <tr><td class="paramname">width</td><td>Width</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Calculated height </dd></dl>

<p>Implemented in <a class="el" href="class_qwt_rich_text_engine.html#ab19cc5ad4ae33aaffc6aaf5d58b93b19">QwtRichTextEngine</a>, <a class="el" href="class_qwt_plain_text_engine.html#a9190bdcb6ed447a5bc056ad8304ad58b">QwtPlainTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#a3d5b7c9be31d9282b4c86c8ec3f4c8df">QwtMathMLTextEngine</a>.</p>

</div>
</div>
<a class="anchor" id="a55e011afec9b5a3f6d79b19652bc2bdf"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool QwtTextEngine::mightRender </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>text</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Test if a string can be rendered by this text engine</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">text</td><td>Text to be tested </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true, if it can be rendered </dd></dl>

<p>Implemented in <a class="el" href="class_qwt_rich_text_engine.html#a42da46eee5fbda55e34b18c64b0b5e0b">QwtRichTextEngine</a>, <a class="el" href="class_qwt_plain_text_engine.html#ae7bd7417f0173e2d35fe1bf7a514ec9b">QwtPlainTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#a59ca5842c32fd12cfd2aeeef5c985600">QwtMathMLTextEngine</a>.</p>

</div>
</div>
<a class="anchor" id="a9f3dbeaffeae25c11d543143229c5c4a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void QwtTextEngine::textMargins </td>
          <td>(</td>
          <td class="paramtype">const QFont &amp;&#160;</td>
          <td class="paramname"><em>font</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double &amp;&#160;</td>
          <td class="paramname"><em>left</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double &amp;&#160;</td>
          <td class="paramname"><em>right</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double &amp;&#160;</td>
          <td class="paramname"><em>top</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double &amp;&#160;</td>
          <td class="paramname"><em>bottom</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Return margins around the texts</p>
<p>The textSize might include margins around the text, like QFontMetrics::descent(). In situations where texts need to be aligned in detail, knowing these margins might improve the layout calculations.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">font</td><td>Font of the text </td></tr>
    <tr><td class="paramname">text</td><td>Text to be rendered </td></tr>
    <tr><td class="paramname">left</td><td>Return value for the left margin </td></tr>
    <tr><td class="paramname">right</td><td>Return value for the right margin </td></tr>
    <tr><td class="paramname">top</td><td>Return value for the top margin </td></tr>
    <tr><td class="paramname">bottom</td><td>Return value for the bottom margin </td></tr>
  </table>
  </dd>
</dl>

<p>Implemented in <a class="el" href="class_qwt_rich_text_engine.html#a3d507f2cad8ce44d0ee5da3070b943ca">QwtRichTextEngine</a>, <a class="el" href="class_qwt_plain_text_engine.html#ac209b74082557d3086cb3b52f99c522d">QwtPlainTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#ae89278f8e3642851b6357e34763008fe">QwtMathMLTextEngine</a>.</p>

</div>
</div>
<a class="anchor" id="a6888b3d286a16a7b8e06db8147e43df0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual QSizeF QwtTextEngine::textSize </td>
          <td>(</td>
          <td class="paramtype">const QFont &amp;&#160;</td>
          <td class="paramname"><em>font</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>text</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns the size, that is needed to render text</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">font</td><td>Font of the text </td></tr>
    <tr><td class="paramname">flags</td><td>Bitwise OR of the flags like in for QPainter::drawText </td></tr>
    <tr><td class="paramname">text</td><td>Text to be rendered</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Calculated size </dd></dl>

<p>Implemented in <a class="el" href="class_qwt_rich_text_engine.html#a0dc185454c60931a0c136fc61774abfb">QwtRichTextEngine</a>, <a class="el" href="class_qwt_plain_text_engine.html#a220628c0e315021a3ae9d4447bf88018">QwtPlainTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#ae2b00277f488f755a3bf7fc19548d0ec">QwtMathMLTextEngine</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_qwt_text_engine.html">QwtTextEngine</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
